package org.leaf.green.b2b

class MarketPriceResearchDetail {               //市场价格调查

    MarketPriceResearch marketPriceResearch     //master
    String serialNumber                         //行号
    String product                              //产品名称
    BigDecimal price                            //市场单价
    Boolean promotion                           //是否促销

    static belongsTo = [marketPriceResearch : MarketPriceResearch]

    static constraints = {
        marketResearch(nullable:false)
        serialNumber(nullable:false, blank:false, maxSize : 3, unique : 'marketPriceResearch')
        product(nullable:false, blank:false,maxSize:60)
        price(nullable:false, scale : 2)
        promotion(nullable:false)
    }

    String toString(){
        return "${serialNumber}"
    }

    static mapping = {
        table 'B2B_MARKET_PRICE_RESEARCH_DETAIL'
    }
}
